#include <algorithm>
#include <cstdio>
//TODO:
const int N = 100;
int n;

struct Triangle {
  int x, y, d;
} tri[N];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("P3219 [HNOI2012]三角形覆盖问题.in", "r", stdin);
  freopen("P3219 [HNOI2012]三角形覆盖问题.out", "w", stdout);
#endif
#endif

  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d%d", &tri[i].x, &tri[i].y, &tri[i].d);
  }
  std::sort(tri + 1, tri + n + 1,
            [](const Triangle &lhs, const Triangle &rhs) { return lhs.x < rhs.x; });
  return 0;
}